/**
 * Created by Administrator on 2025/5/15.
 * */
#ifndef AIE2ENET_ERA
#define AIE2ENET_ERA

#include "CudaModule.h"
#include "../GlobalParameters.h"
#include <string>
#include <zmq.hpp>

extern "C" BaseObject *createAIE2ENet();
extern "C" void destroyAIE2ENet(BaseObject *p);

class AIE2ENet : public CudaModule {
public:
AIE2ENet();

~AIE2ENet();

    void onIssueStreamedCudaOperations(buffer_table_t *input, buffer_table_t *output, cudaStream_t stream) override;
    void zmqRepServe();
//void onPushCudaOperations(buffer_table_t *input, buffer_table_t *output, cudaStream_t stream) override;
private:
    std::string topicAddr = "tcp://192.168.1.115:6001";
    std::string topicName = "MainController";
    zmq::context_t ctx;
    zmq::socket_t sub;
    zmq::socket_t rep_socket;
    std::string rep_address = "tcp://192.168.1.115:6004";
    //
    zmq::socket_t req_AIE2E_socket;
    std::string req_AIE2E_address = "tcp://192.168.1.115:6005";
    int prevStep = -1;
    bool clearOutput1;
};

#endif //TASK1_ERA
